﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Site.Secure
{
    public partial class Logs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try{
            System.IO.FileStream fs = new System.IO.FileStream(Server.MapPath("~/All.log"), System.IO.FileMode.Open);
            System.IO.StreamReader sr = new System.IO.StreamReader(fs);

            while(!sr.EndOfStream)
            {
                ListBox1.Items.Add(sr.ReadLine());
            }

            sr.Close();
            sr.Dispose();

            fs.Close();
            fs.Dispose();
            }
            catch(Exception ex)
            {
                ListBox1.Items.Add("Error Reading Log File");
            }
        }
    }
}